home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48hor1
/
io3.doc
< prev
next >
Wrap
Text File
|
1995-03-31
|
9KB
|
178 lines
IO, 24 powerful (and dangerous) system-level routines by various authors.
Documentation by Joe Horn.
Most of these programs can easily cause a Memory Clear if not used
carefully. Follow these instructions closely, and be sure to backup
your memory before experimenting with these tools.
Note: The term "meta-object" is used below with the same meaning as in
Jim Donnelly's HP 48 ToolKit Manual. A meta-object isn't really an
object, but a collection of objects on the stack, plus a count. For
example, if you type in { 9 8 7 }, that's just one normal object (a
"list object"). But if you now do OBJ-> on it, you get 9 8 7 3 on the
stack (using levels 1 through 4). This is called a meta-object, with
9 8 7 being its contents, and 3 being its count.
Other odd-sounding object types (like "System Binary", "External",
"Code" and so on) are described in HP48SX.DOC in the DNICKEL directory
on this disk.
úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
PRG->: Decomposes a program object into a meta-object on the stack.
By Rick Grevelle.
Input: program object.
Example: << 1 2 + >> PRG-> --> << 1 2 + >> 5 (split up on stack).
Note: PRG-> and ->PRG can be used to edit non-editable programs.
Combined with HEX-> and ->HEX, any possible program can be written and
edited. Also, internal functions can be explored like this: { + }
OBJ-> DROP PRG->. You'll see the "+" program on the stack! (Use
->HEX to find out what each "External" object is.)
->PRG: Converts a meta-object on the stack into a single program object.
By Rick Grevelle.
Input: Any number (n) of objects on the stack, with n on level 1.
Note: The user-program delimiters << and >> are NOT appended.
Example: { 1 2 + } OBJ-> ->PRG --> 1 2 + (all on level 1. Try
EVAL).
->HEX: Converts object to a string of hex digits (poor man's disassembler).
By Rick Grevelle.
Example: { + } ->HEX --> "47A2076BA1B2130".
Note: ->HEX produces only hex digits; no line feeds or checksum. It
may therefore be used to convert any object to the form used by the
Voyager program by Derek Nickel. (Or use his BINTOMEM program.)
HEX->: Converts string of hex digits to an object (poor man's assembler).
By Rick Grevelle.
Example: "47A2076BA1B2130" HEX-> --> { + }.
Note: To engineer a user-created object, type its internal hex
representation as one long string, and press HEX->. Caution: objects
with illegal contents can cause a Memory Clear.
SYSRCL: Recalls system object at given address. Arg = binary integer.
Example: #1AB67h SYSRCL --> +.
ADDR: Yields address of object in level 1.
Example: { + } OBJ-> DROP ADDR yields #1AB67h (the address of +).
->ASC: Converts any object into hex + checksum.
By Bill Wickes.
Example: { + } ->ASC --> "47A2076BA1B2130248F".
Note: ->ASC is like ->HEX above, except for two additional features:
(1) Line feeds are added after every 64 characters, and (2) a 4-digit
CRC checksum is tacked onto the end (248F in the example above). See
Bill Wickes' file ASC.TXT in the DNICKEL directory on this disk.
ASC->: Converts hex + checksum into original object.
By Bill Wickes.
Example: "47A2076BA1B2130248F" ASC-> --> { + }.
Note: ASC-> is like HEX-> above, except that it expects line feeds
after every 64th character, and it requires a correct checksum to be
the final four digits. See Bill Wickes' file ASC.TXT in the DNICKEL
directory on this disk.
->XLIB: Creates any specified XLIB object, from library & token numbers.
By Rick Grevelle. See XLIB.DOC for more information.
Example: 268 12 ->XLIB --> XLIB 268 12 (if you don't have the Eq
Library card plugged in; --> ELVERSION if you do have it. Try
EVAL.) ->XLIB easily creates library functions even when the library
isn't in in memory or attached. It also allows easy access to the
internal Library 240 functions, which are bankswitched and must be
XLIB'd.
XLIB->: Inverse of ->XLIB. See XLIB.DOC for more information.
By Rick Grevelle.
Example: After example above, press XLIB-> and see 268 12.
X->R: XLIB-to-RPL converter. Pulls an XLIB object out of its library.
By Rick Grevelle.
Input: Any XLIB word (for example, MINEHUNT or ELVERSION).
Example: With the EQ Library Card installed, type { MINEHUNT } 1 GET
X->R --> External XLIB 268 63. This is the first level of the
unthreading of the MINEHUNT game.
R->X: RPL-to-XLIB reverter. Reverts an X->R output to its original input.
By Rick Grevelle.
Example: After above example, press R->X and see MINEHUNT.
->SB: Converts to a system binary (also called a "short binary").
Argument: real number. Example: 153 ->SB --> <99h>.
SB->: Converts from a system binary.
Argument: system binary. Example: <99h> SB-> --> 153.
->RPN: Convert algebraic object into equivalent RPN object (list).
By Joe Horn.
Example: '1+2*3+4' ->RPN --> { 1 2 3 * + 4 + }. (Try EVAL).
RPN->: Convert RPN object (list) into equivalent algebraic object.
By Joe Horn.
Example: { 1 2 3 * + 4 + } RPN-> --> '1+2*3+4'. (Try EVAL).
Caution: Converting non-well-formed "RPN objects" into algebraics
will either result in an 'Invalid Expression' or 'UNKNOWN' on the
stack, which will evaluate the same as the list before conversion; or
in Memory Clear (in extreme cases). For safety's sake, only use lists
containing ->RPN outputs, or similar. Things like { << 5 >> } are not
meaningful and tempt fate.
CD->C: Converts hex string to Code object.
Example: "142164808C" CD->C --> Code (a placebo object).
Like A->H, but adds Code prolog & length automatically.
REV: Reverses byte order of a string, very quickly.
By Derek Nickel.
Example: "This is a test" REV --> "tset a si sihT"
STRIP: Strips the << and >> off the program in level 1.
By Conrad Winchester.
Argument: Program object with << and >> delimiters.
Caution: STRIP does not check, it just runs, removing the second
five and second-to-last five nibs of the object in level 1. If you
give it something other than a program, you may get a Memory Clear.
PACK: Packs a program's SYSEVALs into "External" form.
By Joe Horn.
See PACK.DOC on this disk for complete explanation.
This version uses ->HEX and HEX->, programs found in this IO
directory.
PEEK: Gives contents of memory at given address, BACKWARDS.
Example: #0h PEEK --> # 8001FDAD801B9632h.
This means that address #0 is 2, #1 is 3, #3 is 6, etc, backwards.
POKE: Stores binary integer at given address. VERY DANGEROUS!
Example: 153 ADDR #0 POKE --> Memory Clear!
Arguments: Address, # to poke there.
FNXT: Find Next. Searches ROM/RAM for any hex digits.
By Dave Marsh.
Input: #search, #start, any.
Level 1 is DROPped and SYSRCLed when search terminates, which allows
repeated pressing of FNXT. Notice that the argument on level 3 is the
binary number to look for, immediately followed by the number of
digits to look for (minus 1!), which allows you to look for leading
zeros. (#1237 looks for the 8 digits 00000123.)
Example: Code objects begin with #02DCCh. That's 5 hex digits, so
add the digit "4" (one less than 5) to it: #02DCC4h. (Leading zeros
do not need to be typed, of course). To look for all the Code objects
in the operating system (starting at address #0h), type: #2DCC4h #0h
#0h FNXT. Pressing FNXT again finds the next one, etc.
FNXT uses FIND, a program "hidden" in this IO directory.
Note: If you want speed and have a PC handy, don't use FNXT; use the
SEARCH command in Derek Nickel's Voyager program.
PRCL: Recalls contents of an entire port to the stack.
Argument: Port number (real) 0, 1 or 2.
Example: 1 PRCL yields the contents of port 1 on the stack.
àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù
FIND: Searches for #LVL2+(len-1) starting at #LVL1; --> addr-1.
See FNXT for automated use of FIND. Since it isn't too useful by
itself, FIND is "hidden" from the IO menu, but it IS in the IO
directory, and may be used, recalled, purged, etc. For information
about how to hide variables from the menu, see HIDE and NULLNAME.DOC
on the HORN1 disk. (The HIDE program is also in the WALSH library
on the HORN2 disk (this one)).